package com.dyz.leetcode._17_comprehensiveApplication;

public class _219_containsNearbyDuplicate {
    public boolean containsNearbyDuplicate(int[] nums, int k) {
        if(nums==null||nums.length<=1){return false;}
        for (int i = 0; i < nums.length; i++) {
            for (int j = Math.max(i - k, 0); j < i; ++j) {
                if (nums[i] == nums[j]) {return true;}
            }
        }
        return false;

    }
}
